<!-- 管理员:课程考核管理-成绩管理-不及格人员查询；学员:课程考核管理:不及格人员查询 -->
<template>
  <div>
    <el-form label-position="right" label-width="10px" label-suffix="：">
      <table style="width: 100%; border-collapse: separate; border-spacing: 1px; background-color: #95b4db;" class="el-table--fit el-table--border table-data">
        <tr>
          <td class="form-label">
            <span>年&emsp;&emsp;级</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.grade" size="mini" placeholder="请选择年级" @change="handleChangeGrade">
              <el-option v-for="(item, index) in gradeList" :key="index" :label="item.xqszxn" :value="item.xqszxn" />
            </el-select>
          </td>
          <td class="form-label">
            <span>学&emsp;&emsp;期</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.semester" size="mini" multiple collapse-tags clearable placeholder="请选择学期">
              <el-option v-for="(item, index) in semesterList" :key="index" :label="item.xqmc" :value="item.xqmc" />
            </el-select>
          </td>
          <td class="form-label">
            <span>培养层次</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.level" size="mini" clearable placeholder="请选择培养层次">
              <el-option v-for="(item, index) in levelList" :key="index" :value="item.dictValue" :label="item.dictKey" />
            </el-select>
          </td>
          <td class="form-label">
            <span v-if="roleId !== '1490880728751644674'" >学&nbsp;&nbsp;员&nbsp;&nbsp;队</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-if="roleId !== '1490880728751644674'" v-model="queryForm.team" size="mini" clearable placeholder="请选择学员队">
              <el-option v-for="(item, index) in teamList" :key="index" :value="item.deptName" :label="item.deptName" />
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="form-label">
            <span>专&emsp;&emsp;业</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.speName" size="mini" clearable placeholder="请选择专业">
              <el-option v-for="(item, index) in speList" :key="index" :label="item.specialtyName" :value="item.id" />
            </el-select>
          </td>
          <td class="form-label">
            <span>专业班次</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.class" size="mini" clearable placeholder="请选择专业班次">
              <el-option v-for="(item, index) in classList" :key="index" :value="item.yearSpecialtyId" :label="item.className" />
            </el-select>
          </td>
          <td class="form-label">
            <span>学&emsp;&emsp;号</span>
          </td>
          <td class="form-item" colspan="1">
            <el-input v-model="queryForm.studentNo" size="mini" clearable placeholder="请输入学号" />
          </td>
          <td class="form-label">
            <span>姓&emsp;&emsp;名</span>
          </td>
          <td class="form-item" colspan="1">
            <el-input v-model="queryForm.studentName" size="mini" clearable placeholder="请输入姓名" />
          </td>
        </tr>
        <tr>
          <td class="form-label">
            <span>修习类型</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.study" size="mini" clearable placeholder="请选择修习类型">
              <el-option v-for="(item, index) in studyList" :key="index" :label="item.dictValue" :value="item.dictValue" />
            </el-select>
          </td>
          <td class="form-label">
            <span>考核方式</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.exam" size="mini" clearable placeholder="请选择考核方式">
              <el-option v-for="(item, index) in examList" :key="index" :value="item.dictKey" :label="item.dictValue" />
            </el-select>
          </td>
          <td class="form-label">
            <span>不及格门数大于等于</span>
          </td>
          <td class="form-item" colspan="1">
            <el-input-number v-model="queryForm.fail" controls-position="right" size="mini" clearable placeholder="请输入不及格门数下限" style="width: 100%;" />
          </td>
          <td class="form-label">
            <span>学分小于等于</span>
          </td>
          <td class="form-item" colspan="1">
            <el-input-number v-model="queryForm.credit" controls-position="right" size="mini" clearable placeholder="请输入学分上限" style="width: 100%;" />
          </td>
        </tr>
        <tr>
          <td class="form-label">
            <span>计算方式</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.calculate" size="mini" clearable placeholder="请选择考核方式">
              <el-option v-for="(item, index) in calculateList" :key="index" :value="item.dictKey" :label="item.dictValue" />
            </el-select>
          </td>
          <td class="form-label">
            <span>是否经补考</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.makeup" size="mini" clearable placeholder="请选择是否经补考">
              <el-option v-for="(item, index) in makeupList" :key="index" :value="item.dictKey" :label="item.dictValue" />
            </el-select>
          </td>
          <td class="form-label">
            <span>是否包含退（转）学</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.drop" size="mini" clearable placeholder="请选择是否包含退（转）学">
              <el-option v-for="item in dropList" :key="item.value" :label="item.dictValue" :value="item.dictKey" />
            </el-select>
          </td>
          <td class="form-label">
            <span>统计方式</span>
          </td>
          <td class="form-item" colspan="1">
            <el-select v-model="queryForm.statistics" size="mini" placeholder="请选择统计方式">
              <el-option v-for="item in statisticsList" :key="item.value" :label="item.dictValue" :value="item.dictValue" />
            </el-select>
          </td>
        </tr>
      </table>
    </el-form>
    <div class="button-style" style="width: 70px; margin: 15px 0 15px calc(50% - 35px); background: #f1f8fe; border: 1px solid #51aef6;" @click="handleSearch">
      <span style="font-size: 14px; color: #51aef6;">统&emsp;计</span>
    </div>
    <div>
        <el-table
          border
          :data="tableData"
          :span-method="handleRowSpan"
          class="xpaas-table-class"
          row-class-name="xpaas-row-class"
          cell-class-name="xpaas-cell-class"
          header-row-class-name="xpaas-header-row-class"
          header-cell-class-name="xpaas-header-cell-class">
          <el-table-column label="查看历年成绩" prop="setting" min-width="110" align="center">
            <template slot-scope="scope">
              <div class="button-style" style="margin-left: 10%; width: 75px; background: #f1f8fe; border: 1px solid #51aef6;" @click="handleView(scope.row)">
                <img src="@/assets/assessment/icon-look.png" alt="" />
                <span style="font-size: 14px; color: #51aef6;">查看</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="grade" label="年级" show-overflow-tooltip align="center" />
          <el-table-column prop="pylevel" label="培养层次" show-overflow-tooltip align="center" />
          <el-table-column prop="studentdui" label="学员队" show-overflow-tooltip align="center" />
          <el-table-column prop="spectly" label="专业" show-overflow-tooltip align="center" />
          <el-table-column prop="spectlyclass" label="专业班次" show-overflow-tooltip align="center" />
          <el-table-column prop="studentcode" label="学号" show-overflow-tooltip align="center" />
          <el-table-column prop="studentname" label="姓名" show-overflow-tooltip align="center" />
          <el-table-column prop="xuefen" label="已修学分" show-overflow-tooltip align="center" />
          <el-table-column prop="wdbkcnum" label="未达标课程数" show-overflow-tooltip align="center" />
          <el-table-column prop="xueqi" label="学期" show-overflow-tooltip align="center" />
          <el-table-column prop="coursenumber" label="课程编号" show-overflow-tooltip align="center" />
          <el-table-column prop="coursename" label="课程名称" show-overflow-tooltip align="center" />
          <el-table-column prop="xxtype" label="修习类型" show-overflow-tooltip align="center" />
          <el-table-column prop="khfs" label="考核方式" show-overflow-tooltip align="center" />
          <el-table-column prop="issue" label="课终考核成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="bkscore" label="补考成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="twokbscore" label="二次补考成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="zpscore" label="总评成绩" show-overflow-tooltip align="center" />
        </el-table>
    </div>
    <div class="button-style" style="margin-top: 15px;">
      <img src="@/assets/assessment/icon-export.png" alt="" />
      <download-excel
        :data="tableData"
        :fields="jsonFields"
        type="xls"
        name="不及格人员.xls"
        style="font-size: 14px; color: #f3b815;">
        <span>导出Excel</span>
      </download-excel>
    </div>
    <el-dialog title="历年成绩" :visible.sync="dialogShow" width="1400px" style="height: 1000px;">
      <div>
        <el-form label-suffix="：" label-position="left" style="display: flex;">
          <el-form-item label-width="85px" style="width: 16.5%;">
            <template slot="label">
              <span>学&emsp;&emsp;期：</span>
            </template>
            <el-select 
              v-model="dialogSemester" 
              multiple
              collapse-tags
              size="mini"
              clearable 
              placeholder="请选择学期" 
              style="width:138px;margin: 0 20px 0 -15px;"
            >
              <el-option 
                v-for="(item, index) in semesterList1" 
                :key="index" 
                :label="item.xqmc" 
                :value="item.xqmc" 
              />
            </el-select>
          </el-form-item>
          <el-form-item label-width="85px" label="培养层次" style="width: 16.5%;">
            <el-select v-model="dialogForm.level" size="mini" clearable placeholder="请选择培养层次" style="width:138px;margin: 0 20px 0 -15px;">
              <el-option v-for="(item, index) in levelList" :key="index" :value="item.dictValue" :label="item.dictKey" />
            </el-select>
          </el-form-item>
          <el-form-item label-width="85px" label="修习类型" style="width: 16.5%;">
            <el-select v-model="dialogForm.study" size="mini" clearable placeholder="请选择修习类型" style="width:138px;margin: 0 20px 0 -15px;">
              <el-option v-for="(item, index) in studyList" :key="index" :value="item.dictKey" :label="item.dictValue" />
            </el-select>
          </el-form-item>
          <el-form-item label-width="85px" style="width: 16.5%;">
            <template slot="label">
              <span>学&emsp;&emsp;号：</span>
            </template>
            <el-input v-model="dialogForm.studentNo" size="mini" clearable placeholder="请输入学号" style="width:138px;margin: 0 20px 0 -15px;" />
          </el-form-item>
          <el-form-item label-width="85px" label="学员姓名" style="width: 16.5%;">
            <el-input v-model="dialogForm.studentName" size="mini" clearable placeholder="请输入学员姓名" style="width:138px;margin: 0 20px 0 -15px;" />
          </el-form-item>
          <el-form-item label-width="85px" style="width: 16.5%;">
            <template slot="label">
              <span>学&nbsp;员&nbsp;队&nbsp;：</span>
            </template>
            <el-select v-model="dialogForm.team" size="mini" clearable placeholder="请选择学员队" style="width:138px;margin: 0 20px 0 -15px;">
              <el-option v-for="(item, index) in teamList" :key="index" :value="item.id" :label="item.deptName" />
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-form label-suffix="：" label-position="left" style="display: flex;">
          <el-form-item label-width="85px" style="width: 16.5%;">
            <template slot="label">
              <span>年&emsp;&emsp;级：</span>
            </template>
            <el-select v-model="dialogForm.grade" size="mini" clearable placeholder="请选择年级" style="width:138px;margin: 0 20px 0 -15px;" @change="handleChangeGrade1">
              <el-option v-for="(item, index) in gradeList" :key="index" :label="item.xqszxn" :value="item.xqszxn" />
            </el-select>
          </el-form-item>
          <el-form-item label-width="85px" label="专业班次" style="width: 16.5%;">
            <el-select v-model="dialogForm.class" size="mini" clearable placeholder="请选择专业班次" style="width:138px;margin: 0 20px 0 -15px;">
              <el-option v-for="(item, index) in classList" :key="index" :value="item.yearSpecialtyId" :label="item.className" />
            </el-select>
          </el-form-item>
          <el-form-item label-width="85px" label="课程名称" style="width: 16.5%;">
            <el-input v-model="dialogForm.courseName" size="mini" clearable placeholder="请输入课程名称" style="width:138px;margin: 0 20px 0 -15px;" />
          </el-form-item>
          <el-form-item label-width="85px" label="课程编号" style="width: 16.5%;">
            <el-input v-model="dialogForm.courseNo" size="mini" clearable placeholder="请输入课程编号" style="width:138px;margin: 0 20px 0 -15px;" />
          </el-form-item>
          <el-form-item style="width: 16.5%;">
            <span class="el-form-item__label">查看期中不及格人员：</span>
            <el-checkbox v-model="dialogForm.interim" @change="handleChangeInterim" />
          </el-form-item>
          <el-form-item style="width: 16.5%;">
            <span class="el-form-item__label">查看总评不及格人员：</span>
            <el-checkbox v-model="dialogForm.appraisal" @change="handleChangeAppraisal" />
          </el-form-item>
          <el-form-item style="width: 7%;">
            <div class="button-style" style="width: 75px; margin: 6px 0 0 21px; background: #f1f8fe; border: 1px solid #51aef6;" @click="handleSearch1Long">
              <img src="@/assets/assessment/icon-search.png" alt="" />
              <span style="font-size: 14px; color: #51aef6;">查询</span>
            </div>
          </el-form-item>
        </el-form>
      </div>
      <div style="margin: 5px 0 15px 0;">
        <el-table
          border
          :height="340"
          :data="tableData1"
          class="xpaas-table-class"
          row-class-name="xpaas-row-class"
          cell-class-name="xpaas-cell-class"
          header-row-class-name="xpaas-header-row-class"
          header-cell-class-name="xpaas-header-cell-class">
          <el-table-column prop="xueqi" label="学期" show-overflow-tooltip align="center" />
          <el-table-column prop="grade" label="年级" show-overflow-tooltip align="center" />
          <el-table-column prop="spectlyclass" label="专业班次" show-overflow-tooltip align="center" />
          <el-table-column prop="coursenumber" label="课程编号" show-overflow-tooltip align="center" />
          <el-table-column prop="coursename" label="课程名称" show-overflow-tooltip align="center" />
          <el-table-column prop="xxtype" label="修习类型" show-overflow-tooltip align="center" />
          <el-table-column prop="studentcode" label="学号" show-overflow-tooltip align="center" />
          <el-table-column prop="studentname" label="姓名" show-overflow-tooltip align="center" />
          <el-table-column prop="col9" label="课下作业成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col10" label="课堂测评成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col11" label="期中考试成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col12" label="课终考核成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col13" label="补考成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col14" label="第二次补考成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col15" label="总评成绩" show-overflow-tooltip align="center" />
          <el-table-column prop="col16" label="备注" show-overflow-tooltip align="center" />
        </el-table>
      </div>
      <div class="button-style">
        <img src="@/assets/assessment/icon-export.png" alt="" />
        <download-excel
          :data="tableData1"
          :fields="jsonFields1"
          type="xls"
          name="学员历年成绩.xls"
          style="font-size: 14px; color: #f3b815;">
          <span>导出Excel</span>
        </download-excel>
      </div>
      <div style="float: right; padding-bottom: 15px;">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          style="padding: 0;">
        </el-pagination>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getStore } from '@/util/store.js'
import { reqChoosezylist } from '@/api/propositionReview/approval'
import { reqGetXqList, reqCheckLevelList, querySemesterByYear, reqCheckYearList, reqXydList, reqZybcList, queryDictByCode, queryFailList, queryallscorejk } from '@/api/admin1/check'
export default {
  data() {
    return {
      roleId: '',
      pageNo: 1,
      pageSize: 10,
      total: 0,
      semesterList: [],
      semesterList1: [],
      levelList: [],
      gradeList: [],
      teamList: [],
      speList: [],
      classList: [],
      studyList: [],
      examList: [],
      calculateList: [],
      makeupList: [],
      dropList: [],
      statisticsList: [],
      dialogSemester:'',
      queryForm: {
        semester: '',
        level: '',
        grade: '',
        team: '',
        speName: '',
        class: '',
        studentNo: '',
        studentName: '',
        study: '',
        exam: '',
        fail: undefined,
        credit: undefined,
        calculate: '',
        makeup: '',
        drop: '',
        statistics: ''
      },
      dialogForm: {
        semester: '',
        level: '',
        study: '',
        studentNo: '',
        studentName: '',
        team: '',
        grade: '',
        class: '',
        courseName: '',
        courseNo: '',
        interim: false,
        appraisal: false
      },
      tableData: [],
      tableData: [],
      studentNo: '',
      rowSpanArray: [],
      dialogShow: false,
      jsonFields: {
        年级: 'col1',
        培养层次: 'col2',
        学员队: 'col3',
        专业: 'col4',
        专业班次: 'col5',
        学号: 'col6',
        姓名: 'col7',
        已修学分: 'col8',
        未达标课程数: 'col9',
        学期: 'col10',
        课程编号: 'col11',
        课程名称: 'col12',
        修习类型: 'col13',
        考核方式: 'col14',
        课终考核成绩: 'col15',
        补考成绩: 'col16',
        二次补考成绩: 'col17',
        总评成绩: 'col18'
      },
      jsonFields1: {
        学期: 'col1',
        年级: 'col2',
        专业班次: 'col3',
        课程编号: 'col4',
        课程名称: 'col5',
        修习类型: 'col6',
        学号: 'col7',
        姓名: 'col8',
        课下作业成绩: 'col9',
        课堂测评成绩: 'col10',
        期中考试成绩: 'col11',
        课终考核成绩: 'col12',
        补考成绩: 'col13',
        第二次补考成绩: 'col14',
        总评成绩: 'col15',
        备注: 'col16'
      }
    }
  },
  computed: {
    config() {
      return {
        mergeTarget: "studentcode", // 通用依据
        combineProp: [
          // combineProp - 根据mergeTarge 进行合并的单元格属性
          "setting",
          "grade",
          "pylevel",
          "studentdui",
          "spectly",
          "spectlyclass",
          "studentcode",
          "studentname",
          "xuefen",
          "wdbkcnum"
        ],
      };
    },
    // ...mapGetters(['userInfo']),
  },
  mounted () {
    const userInfo = getStore({
      name: "userInfo",
      debug: true,
    }) || {}
    this.roleId = userInfo.content.role_id
    reqCheckYearList().then((res) => {
      if (res.data.data && res.data.data.length > 0) {
        this.gradeList = res.data.data
        this.queryForm.grade = res.data.data[0].xqszxn
        this.handleChangeGrade(res.data.data[0].xqszxn)
      }
    })
    reqGetXqList().then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.semesterList = res.data.data
      }
    })
    reqCheckLevelList().then(res => {
      if(res.data.data && res.data.data.length > 0){
        this.levelList = res.data.data[0].children
      }
    })
    reqXydList().then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.teamList = res.data.data
      }
    })
    reqChoosezylist().then((res) => {
        if (res.data.data && res.data.data.length > 0) {
          this.speList = res.data.data
        }
    })
    reqZybcList().then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.classList = res.data.data
      }
    })
    queryDictByCode('xxType').then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.studyList = res.data.data
      }
    })
    queryDictByCode('khfsType').then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.examList = res.data.data[0].childdictBizs
      }
    })
    queryDictByCode('calculateType').then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.calculateList = res.data.data
      }
    })
    queryDictByCode('judge').then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.makeupList = res.data.data
        this.dropList = res.data.data
      }
    })
    queryDictByCode('assessment').then(res => {
      if (res.data.data && res.data.data.length > 0) {
        this.statisticsList = res.data.data
        this.statisticsList.splice(1, 1)
        this.statisticsList.splice(2, 2)
        this.queryForm.statistics = res.data.data[0].dictValue
        this.handleSearch()
      }
    })
  },
  methods: {
    handleChangeGrade: function (val) {
      this.queryForm.semester = ''
      if (val === '') {
        reqGetXqList().then(res => {
          if (res.data.data && res.data.data.length > 0) {
            this.semesterList = res.data.data
          }
        })
      } else {
        querySemesterByYear(val).then(res => {
          if (res.data.data && res.data.data.length > 0) {
            this.semesterList = res.data.data
          }
        })
      }
    },
    handleChangeGrade1: function (val) {
      this.dialogSemester = ''
      querySemesterByYear(val).then(res => {
        if (res.data.data && res.data.data.length > 0) {
          this.semesterList1 = res.data.data;
        }
      })
    },
    initXqList(val){
      if (val === '') {
        reqGetXqList().then(res => {
          if (res.data.data && res.data.data.length > 0) {
            this.semesterList1 = res.data.data
          }
        })
      } else {
        querySemesterByYear(val).then(res => {
          if (res.data.data && res.data.data.length > 0) {
            this.semesterList1 = res.data.data;
          }
        })
      }
    },
    handleSearch: function () {
      const params = {
        bjgmsdydynum: this.queryForm.fail === undefined ? '' : this.queryForm.fail,
        grade: this.queryForm.grade,
        jsfs: this.queryForm.calculate,
        ksfsl: this.queryForm.exam,
        pylevel: this.queryForm.level,
        sfjbk: this.queryForm.makeup,
        spectly: this.queryForm.speName,
        spectlyclass: this.queryForm.class,
        studentcode: this.queryForm.studentNo,
        studentdui: this.queryForm.team,
        studentname: this.queryForm.studentName,
        tjfs: this.queryForm.statistics,
        tuizhuanxuel: this.queryForm.drop,
        xfxydy: this.queryForm.credit === undefined ? '' : this.queryForm.credit,
        xueqi: this.queryForm.level.semester > 0 ? this.queryForm.semester.join(',') : '',
        xxtype: this.queryForm.study
      }
      queryFailList(params).then(res => {
        if (res.data.data && res.data.data.length > 0) {
          this.tableData = res.data.data
          this.mergeRow()
          this.total = res.data.data.total
          // 记录需要合并行的行序号
          // this.tableData.forEach((item, index) => {
          //   if (this.studentNo !== item.studentcode) {
          //     this.studentNo = item.studentcode
          //     this.rowSpanArray.push(index)
          //   }
          // })
        } else {
          this.tableData = []
          this.total = 0
        }
      })
    },
    handleSearch1: function (xueq) {
      console.log(xueq)
      const params = {
        xueqi: xueq,
        level: this.dialogForm.level,
        studytypecode: this.dialogForm.study,
        studentid: this.dialogForm.studentNo,
        name: this.dialogForm.studentName,
        classes: this.dialogForm.team,
        grade: this.dialogForm.grade,
        majorclass: this.dialogForm.class,
        prelectcourse: this.dialogForm.courseName,
        courseno: this.dialogForm.courseNo,
        qzbjg: this.dialogForm.interim,
        zpbjg: this.dialogForm.appraisal
      }
      queryallscorejk(params).then(res => {
        console.log(res.data.data, '1111111111111')
        if (res.data.data && res.data.data.length > 0) {
          this.tableData1 = res.data.data
          this.total = res.data.data.length
        } else {
          this.tableData1 = []
          this.total = 0
        }
      })
    },
    handleSearch1Long(){
      if(this.dialogSemester.length == 0){
        this.dialogForm.semester = '';
      } else {
        this.dialogForm.semester = this.dialogSemester.toString();
      }
      this.handleSearch1(this.dialogForm.semester)
    },
    handleView: function (row) {
      this.dialogShow = true
      this.dialogSemester = row.xueqi.split(',')
      this.dialogForm.grade = row.grade
      this.dialogForm.level = row.pylevel
      this.dialogForm.study = row.xxtype
      this.dialogForm.studentNo = row.studentcode
      this.dialogForm.studentName = row.studentname
      this.dialogForm.team = row.studentdui
      this.dialogForm.class =  row.spectlyclass
      this.dialogForm.courseName = row.coursename
      this.dialogForm.courseNo = row.coursenumber
      this.initXqList(row.grade)
      this.handleSearch1(row.xueqi)
    },
    // handleRowSpan: function ({ row, rowIndex, columnIndex }) {
    //   if (columnIndex <= 9) {
    //     if (this.rowSpanArray.indexOf(rowIndex) >= 0) {
    //       return {
    //         rowspan: row.wdbkcnum,
    //         colspan: 1
    //       }
    //     } else {
    //       return {
    //         rowspan: 0,
    //         colspan: 0
    //       }
    //     }
    //   }
    // },
    handleChangeInterim: function (val) {
      this.dialogForm.appraisal = val ? !val : this.dialogForm.appraisal
    },
    handleChangeAppraisal: function (val) {
      this.dialogForm.interim = val ? !val : this.dialogForm.interim
    },
    handleSizeChange: function (val) {
      this.pageSize = val
      this.handleSearch1()
    },
    handleCurrentChange: function (val) {
      this.pageNo = val
      this.handleSearch1()
    },
    //表格做合并
    handleRowSpan({ row, column }) {
      const span = column["property"] + "-span";
      if (row[span]) {
        return row[span];
      }
    },
    mergeRow() {
      let newArr = [].concat(this.tableData);
      // arr.splice(index, 0, Object.assign({}, row))
      this.tableData = this.mergeData(newArr);
    },
    mergeData(list) {
      // mergeTarge - 合并项依据
      // combineProp - 根据mergeTarge 进行合并的单元格属性
      return this.filterData(this.config, [].concat(list));
    },
    isObject(val) {
      return Object.prototype.toString.call(val) === "[object Object]";
    },
    isEmpty(val) {
      return typeof val == "undefined" || val === null || val == "-";
    },
    filterData(config, tableData, targetProp) {
      const { mergeTarget, combineProp } = config;
      // 叠加的合并条件
      combineProp.forEach((column) => {
        // 记录合并项
        let combineCount = 1;
        if (this.isObject(column)) {
          return this.filterData.call(this, column, tableData, mergeTarget);
        }
        // 使用倒序遍历
        for (let i = tableData.length - 1; i >= 0; i--) {
          let curr = tableData[i],
            prev = tableData[i - 1];

          if (this.isEmpty(prev)) {
            // 已经循环完毕
            curr[`${column}-span`] = {
              rowspan: combineCount,
              colspan: combineCount >= 1 ? 1 : 0,
            };
            break;
          }

          if (
            prev[targetProp] === curr[targetProp] &&
            prev[mergeTarget] === curr[mergeTarget] &&
            prev[`${column}`] === curr[`${column}`]
          ) {
            ++combineCount;
            curr[`${column}-span`] = {
              rowspan: 0,
              colspan: 0,
            };
          } else {
            curr[`${column}-span`] = {
              rowspan: combineCount,
              colspan: combineCount >= 1 ? 1 : 0,
            };
            prev[`${column}-span`] = {
              rowspan: 1,
              colspan: 1,
            };
            // 前后项不相符时，对combinecount进行重置
            combineCount = 1;
          }
        }
      });
      return tableData;
    },
  }
}
</script>
<style lang="less" scoped>
  @fontFamily:"Microsoft YaHei";
  .xpaas-table-class {
    border: 1px solid #004ca7;
    border-radius: 9px;
    ::v-deep div.el-table__header-wrapper {
      table.el-table__header {
        thead {
          tr.xpaas-header-row-class {
            padding: 0;
            height: 60px;
            background-color: #edf2f9;
            font-size: 16px;
            font-family: @fontFamily;
            font-weight: bold;
            line-height: 20px;
            color: #004ca7;
            th.xpaas-header-cell-class {
              font-weight: bold;
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              background-color: #edf2f9;
              div.cell {
                font-size: 16px;
                font-weight: bold;
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
          }
        }
      }
    }
    ::v-deep div.el-table__body-wrapper {
      table.el-table__body {
        tbody {
          tr.xpaas-row-class {
            td.xpaas-header-cell-class {
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              background-color: #edf2f9;
              div.cell {
                font-size: 16px;
                font-weight: bold;
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
            td.xpaas-cell-class {
              height: 60px;
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              div.cell {
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
          }
        }
      }
    }
  }
  td.form-label {
    background-color: #edf2f9;
    color: #004ca7;
    font-size: 15px;
    font-weight: bold;
    line-height: 50px;
    width: 10%;
    text-align: center;
  }
  td.form-item {
    background-color: #ffffff;
    color: #004ca7;
    font-size: 15px;
    line-height: 50px;
    width: 15%;
    text-align: left;
    padding-left: 30px;
    padding-right: 30px;
    .el-select {
      width: 100%;
    }
    span {
      display: inline-block;
      margin: 0 0 0 1vh;
    }
  }
  .button-style {
    float: left;
    background: #fff6ef;
    border: 1px solid #f3b815;
    width: 110px;
    height: 28px;
    line-height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    box-sizing: border-box;
    > img {
      width: 16px;
      height: 16px;
      margin-right: 5px;
    }
  }
  /deep/ .el-form-item__label {
    color: #004ca7;
    font-size: 14px;
  }
  /deep/ .el-dialog {
    overflow-y: hidden;
  }
</style>
